<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/template.xhtml">
    <ui:define name="content">
    <h:form id="UserSystemForm" align="center">
			<br />     
		<div align="center" style="width : 800px; font-size:11pt">
		<p:panel>
            <f:facet name="header" >
			<h3><h:outputText value="Create New User" /></h3>
            </f:facet>
            <br />
        	<h:outputText  value="Please enter user information below required field are marked with *" /><br/><br/>
    	
        		<h:panelGrid columns="5" style="margin-right:10px; cellspacing : 10pt">
        			
        			<h:outputText value="User Id: "  />
        			<p:inputText value="#{userBean.userId}" required="false" readonly="true" styleClass="tb5" style="width: 50px;" />
        			<p:spacer width="30"/>
        			<h:outputText value="*First Name: "  />
        			<p:inputText value="#{userBean.user.firstName}" required="true" styleClass="tb5" />
        			
        			
        			<h:outputText value="*Last Name: "  />
        			<p:inputText value="#{userBean.user.lastName}" required="true" styleClass="tb5"/>
        			<p:spacer width="30"/>
        			
        			<h:outputText value="Middle Initial: "  />
        			
        			<p:inputText value="#{userBean.user.middleInitial}" required="false"  styleClass="tb5" style="width: 50px;" />
        			
        			
        			<h:outputText value="*Job: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.jobId}" required="true"  >
        				<f:selectItems value="#{userBean.jobs}"/>
        			</p:selectOneMenu>
        			
        			<p:spacer width="30"/>
        			<h:outputText value="*Provider: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.providerId}" required="true"  >
        				<f:selectItems value="#{userBean.providers}"/>
        			</p:selectOneMenu>
        			
        			
        			<h:outputText value="*User Category: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.userType}" required="true"  >
        				<f:selectItem itemLabel="Internal" itemValue="True"/>
        				<f:selectItem  itemLabel="External" itemValue="False"/>
        			</p:selectOneMenu>
        			<p:spacer width="30"/>
        			
        			<h:outputText value="*Address: "  />
        			
        			<p:inputText value="#{userBean.user.userAddress}" required="true" styleClass="tb5"/>
        		
        			
        			<h:outputText value="*City: "  />
        			
        			<p:inputText value="#{userBean.user.userCity}" required="true" styleClass="tb5"/>
        		
        			<p:spacer width="30"/>
        			<h:outputText value="*State: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.userState}" required="true"  >
        				<f:selectItem itemLabel="ALABAMA	 " itemValue="AL" />
						<f:selectItem itemLabel="ALASKA	 " itemValue="AK" />
						<f:selectItem itemLabel="AMERICAN SAMOA	 " itemValue="AS" />
						<f:selectItem itemLabel="ARIZONA	 " itemValue="AZ" />
<f:selectItem itemLabel="ARKANSAS" itemValue="AR" />
<f:selectItem itemLabel="CALIFORNIA" itemValue="CA" />
<f:selectItem itemLabel="COLORADO" itemValue="CO" />
<f:selectItem itemLabel="CONNECTICUT" itemValue="CT" />
<f:selectItem itemLabel="DELAWARE" itemValue="DE" />
<f:selectItem itemLabel="DISTRICT OF COLUMBIA" itemValue="DC" />
<f:selectItem itemLabel="FEDERATED STATES OF MICRONESIA" itemValue="FM" />
<f:selectItem itemLabel="FLORIDA" itemValue="FL" />
<f:selectItem itemLabel="GEORGIA" itemValue="GA" />
<f:selectItem itemLabel="GUAM GU" itemValue="GU" />
<f:selectItem itemLabel="HAWAII" itemValue="HI" />
<f:selectItem itemLabel="IDAHO" itemValue="ID" />
<f:selectItem itemLabel="ILLINOIS" itemValue="IL" />
<f:selectItem itemLabel="INDIANA" itemValue="IN" />
<f:selectItem itemLabel="IOWA" itemValue="IA" />
<f:selectItem itemLabel="KANSAS" itemValue="KS" />
<f:selectItem itemLabel="KENTUCKY	" itemValue="KY" />
<f:selectItem itemLabel="LOUISIANA" itemValue="LA" />
<f:selectItem itemLabel="MAINE	" itemValue="ME" />
<f:selectItem itemLabel="MARSHALL ISLANDS" itemValue="MH" />
<f:selectItem itemLabel="MARYLAND" itemValue="MD" />
<f:selectItem itemLabel="MASSACHUSETTS" itemValue="MA" />
<f:selectItem itemLabel="MICHIGAN" itemValue="MI" />
<f:selectItem itemLabel="MINNESOTA" itemValue="MN" />
<f:selectItem itemLabel="MISSISSIPPI" itemValue="MS" />
<f:selectItem itemLabel="MISSOURI" itemValue="MO" />
<f:selectItem itemLabel="MONTANA" itemValue="MT" />
<f:selectItem itemLabel="NEBRASKA" itemValue="NE" />
<f:selectItem itemLabel="NEVADA" itemValue="NV" />
<f:selectItem itemLabel="NEW HAMPSHIRE" itemValue="NH" />
<f:selectItem itemLabel="NEW JERSEY" itemValue="NJ" />
<f:selectItem itemLabel="NEW MEXICO" itemValue="NM" />
<f:selectItem itemLabel="NEW YORK" itemValue="NY" />
<f:selectItem itemLabel="NORTH CAROLINA" itemValue="NC" />
<f:selectItem itemLabel="NORTH DAKOTA" itemValue="ND" />
<f:selectItem itemLabel="NORTHERN MARIANA ISLANDS" itemValue="MP" />
<f:selectItem itemLabel="OHIO" itemValue="OH" />
<f:selectItem itemLabel="OKLAHOMA" itemValue="OK" />
<f:selectItem itemLabel="OREGON" itemValue="OR" />
<f:selectItem itemLabel="PALAU" itemValue="PW" />
<f:selectItem itemLabel="PENNSYLVANIA" itemValue="PA" />
<f:selectItem itemLabel="PUERTO RICO" itemValue="PR" />
<f:selectItem itemLabel="RHODE ISLAND" itemValue="RI" />
<f:selectItem itemLabel="SOUTH CAROLINA" itemValue="SC" />
<f:selectItem itemLabel="SOUTH DAKOTA" itemValue="SD" />
<f:selectItem itemLabel="TENNESSEE" itemValue="TN" />
<f:selectItem itemLabel="TEXAS" itemValue="TX" />
<f:selectItem itemLabel="UTAH" itemValue="UT" />
<f:selectItem itemLabel="VERMONT" itemValue="VT" />
<f:selectItem itemLabel="VIRGIN ISLANDS" itemValue="VI" />
<f:selectItem itemLabel="VIRGINIA" itemValue="VA" />
<f:selectItem itemLabel="WASHINGTON" itemValue="WA" />
<f:selectItem itemLabel="WEST VIRGINIA" itemValue="WV" />
<f:selectItem itemLabel="WISCONSIN" itemValue="WI" />
<f:selectItem itemLabel="WYOMING" itemValue="WY" />
        			</p:selectOneMenu>
        		
        			
        			<h:outputText value="*Zip: "  />
        			
        			<p:inputText value="#{userBean.user.userZip}" required="true" styleClass="tb5"/>
        		
        			<p:spacer width="30"/>
        			<h:outputText value="*Country: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.userCountry}" required="true"  >
        				<f:selectItem itemLabel="United States" itemValue="USA"/>
        				<f:selectItem itemLabel="Germany" itemValue="GER"/>
        				<f:selectItem itemLabel="Italy" itemValue="ITA"/>
        			</p:selectOneMenu>
        		
        			
        			<h:outputText value="*Phone No: "  />
        			
        			<p:inputMask value="#{userBean.user.userPhone}" required="true" mask="(999) 999-9999" />
        			<p:spacer width="30"/>
        			
        			<h:outputText value="*Status: "  />
        			
        			<p:selectOneMenu  value="#{userBean.user.userStatus}" required="true"  >
        				<f:selectItem itemLabel="Active" itemValue="True"/>
        				<f:selectItem  itemLabel="Inactive" itemValue="False"/>
        			</p:selectOneMenu>
        			
        			
        			<h:outputText value="*Email Address: "  />
        		<p:inputText value="#{userBean.user.userEmail}" required="true" styleClass="tb5" style="width: 150px; "/>
        		</h:panelGrid>
        		
        		<br/>
        		
        			
        			<p:commandButton value="Reset" type="reset"/>
        			
        			<p:commandButton value="Create" action="#{userBean.createUser}" oncomplete="alert('User Created!!!')"/>
        			
        			<p:commandButton value="Cancel" onclick="location.href='userhome.jsf'"/>
        		
    		</p:panel>
		</div>
		</h:form>

    </ui:define>
</ui:composition>
